<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="format-detection" content="telephone=no">
		<title>51微贷</title>
		<link rel="stylesheet" type="text/css" href="../css/reset.css">
		<link rel="stylesheet" type="text/css" href="../css/common.css">
		<link rel="stylesheet" type="text/css" href="../css/icomoon/style.css">
		<script type="text/javascript" src="../js/rem.js"></script>
	</head>

	<body onload="loaded()">
		<div id="content">
			<h3 class="header f-pr">
				<span>账户设置</span>
				<i class="icon-angle-left f-pa" v-on:tap="back()"></i>
			</h3>
			<div class="wrapper" id="wrapper">
				<div class="scroller" id="scroller">
					<div class="m-security m-accountset">
						<ul class="common-list">
							<li>
								<span>用户名</span>
								<span class="f-fr">
									<small class="mr" v-text="account">6755346</small>
								</span>
							</li>
							<li>
								<span>性别</span>
								<span class="f-fr">
									<small class="mr" v-text="gender">女</small>
								</span>
							</li>
							<li>
								<span>证件类型</span>
								<span class="f-fr">
									<small class="mr" v-text="id_type">身份证</small>
								</span>
							</li>
							<li>
								<span>证件号码</span>
								<span class="f-fr">
									<small class="mr" v-text="id_number">123456789</small>
								</span>
							</li>
						</ul>
						<ul class="common-list">
							<!--<li>
								<span>生日</span>
								<span class="f-fr">
									<small class="mr" v-text="birthday">1970-11-12</small>
								</span>
							</li>-->

						</ul>
						<a class="logout">安全退出</a>
					</div>
				</div>
			</div>
		</div>
		<script type="text/javascript" src="../js/md5.min.js"></script>
		<script type="text/javascript" src="../js/mui.min.js"></script>
		<script type="text/javascript" src="../js/zepto.min.js"></script>
		<script type="text/javascript" src="../js/vue.min.js"></script>
		<script type="text/javascript" src="../js/iscroll.js"></script>
		<script type="text/javascript" src="../js/scroller.js"></script>
		<script type="text/javascript" src="../js/common.js"></script>
		<script type="text/javascript">
			mui.plusReady(function() {
				var vm = new Vue({
					el: '#content',
					data: {
						account: '',
						gender: '',
						id_number: '',
						id_type: ''
					},
					methods: {
						back: function() {
							mui.back();
						}
					}
				});

				var userInfo = {
					init: function() {
						mui.ajax(base + 'account/information', {
							type: 'get',
							data: {
								'id': parseInt(plus.storage.getItem('user_id'))
							},
							dataType: 'json',
							headers: sign(md5),
							success: function(data) {
								vm.account = data.account;
								vm.gender = data.gender;
								vm.id_number = data.id_number;
								vm.id_type = data.id_type;
							},
							error: function() {
								console.info('error');
							}
						});
					}
				}

				userInfo.init();

				$('.logout').bind('tap', function() {
					var btnArray = ['否', '是'];
					mui.confirm('确认退出当前账号？', '安全退出', btnArray, function(e) {
						if(e.index == 1) {
							plus.storage.removeItem('user_id');
							//触发个人中心页面登录成功自定义事件
							var accountwebview = plus.webview.getWebviewById('html/account.html');
							mui.fire(accountwebview, 'logout', {});
							plus.webview.currentWebview().close();
						}
					})
				});
			});
		</script>
	</body>

</html>